<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
	$(document).ready(function(){
		$("#writeBtn").click(function(){
			if($("#title").val()==""){
				alert("제목을 입력하세요!");
				$("#title").focus();
				return false;
			}else if($("#content").val()==""){
				alert("내용을 입력하세요!");
				$("#content").focus();
				return false;
			}else{
				$("#writeForm").submit();
			}
		});
	});
</script>

<form id="writeForm" action="writeQuestion.do" method="post">
 <table width="300px">
 	 <thead align="left">
	 <tr>
		<td>작성자</td>
		<td><input type="text" name="id" id="id" readonly value="${sessionScope.cvo.id }"></td>
	 </tr>
	 <tr>
		<td>문의 제목</td>
		<td><input type="text" name="title" id="title"></td>
	 </tr>
	 </thead>
	 <tbody align="left">
	 <tr>
		<td colspan=2>
			문의내용
			<br>
			<textarea cols="32" rows="10" name="content" id="content"></textarea>
		</td>
	 </tr>
	 </tbody>
	 <tfoot align="left">
	 <tr>
	 	<td  colspan=2 >
	 		<input type="button" id="writeBtn" value="문의글 쓰기">
	 		<input type="reset" value="복원 하기">	 		
	 	</td>
	 </tr>
	 </tfoot>
 </table> 
 </form>
